package com.imc.api.attence.dao;

import com.imc.api.attence.pojo.Lesson;
import com.imc.api.order.pojo.LessonSchedule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * 类描述：课程mapper
 * 开发者：tanweiping
 * 创建日期：2018/10/28 20:44
 */
@Mapper
public interface LessonMapper {

    /*
     * YT  2018/10/28 20:44
     * 方法描述：根据课程ID和用户ID查询课时列表
     */
    List <LessonSchedule> querySchedule(
            @Param("child") String child,
            @Param("lessonId") String lessonId,
            @Param("userId") String userId);

    List <LessonSchedule> queryScheduleForSign(@Param("lessonId") String lessonId);

    /*
     * YT  2018/10/28 20:45
     * 方法描述：根据课时ID查询老师ID
     */
    @Select("select DISTINCT lesson.teacherId from t_lesson lesson\n" +
            "INNER JOIN t_lesson_schedule schdule ON lesson.id = schdule.parentId\n" +
            "WHERE schdule.id = #{schduleId}")
    String getTeacherId(@Param("schduleId") String schduleId);
}
